package com.lzw.breadknife.sample.ui;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.lzw.breadknife.BreadKnife;
import com.lzw.breadknife.Unbinder;

/**
 * author  : AWeiLoveAndroid
 * e-mail  : lzw460433675@163.com
 * github  : https://gitee.com/AWeiLoveAndroid/BreadKnife
 * project : BreadKnife
 */
public abstract class BaseFragment<T extends Unbinder> extends Fragment {

    T unBinderClass;

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        unBinderClass = (T) BreadKnife.bind(this, inflater);
        return unBinderClass.inflate();
    }

    protected abstract int attachLayoutRes();
}
